<include file="Public:header" />
<div class="container main">
    <include file="Public:left" />
    <div class="w790">
        <div class="h">
            <a href="{:U('index')}" class="btn btn-info">
                <i class="glyphicon glyphicon-circle-arrow-left"></i> 返回栏目列表
            </a>
        </div>
        <form class="checkoutform" action="{:U('insert')}" method="post">
            <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
                <div class="form-group">
                    <label class="col-sm-2 control-label">名称</label>
                    <div class="col-sm-10">
                        <input class="form-control" datatype="*" name="name" type="text" value="{$info.name}" id="name">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数量</label>
                    <div class="col-sm-10">
                        <input class="form-control" datatype="*" name="integralnum" type="number" value="{$info.integralnum}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">规则分类</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="type_id" id="type_id">
                            <volist name="ruletype" id="vo">
                                <option value="{$vo.id}">{$vo.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div>
                    <label class="col-sm-2 control-label">积分类型</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="is_important" id="is_important" >
                            <option value="0">普通规则</option>
                            <option value="1">核心规则</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">审核人</label>
                    <div class="col-sm-10">
                        <select class="form-control f-membergroup" >
                        	<option>请选择部门</option>
                            <volist name="membergroup" id="vo">
                                <option value="{$vo.id}">{$vo.title}</option>
                            </volist>
                        </select>
                        <select class="form-control f-memberid" name="member_id" id="member_id" >
                            <option>请选择员工</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">备注</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" name="remark" class="" cols="50" rows="6" id="remark">
                            {$info.remark}
                        </textarea>
                    </div>
                </div>
                <div class="pages">
                    <button type="submit" class="btn btn-success">提交</button>
                </div>
            </table>
        </form>
    </div>
    <div class="clear">
    </div>
</div>
<script>
//当部门改变，显示相应部门的员工
$(".f-membergroup").change(function(e) {
	$.getJSON("{:U('getmember')}",{'groupid':$(this).val()},function(data){
		if(data.statu!=1){return;}
		$(".f-memberid").html('<option value="">请选择</option>');
		$(data.member).each(function(index, element) {
			$(".f-memberid").append('<option value="'+element.id+'">'+element.name+'</option>');
		});
   });
}); 
</script>
</body></html>